<template>
	<view class="pager">
		<view class="header">
		</view>
		<view class="login">
			<view class="panel">
				<view class="line">
					<image src="/static/phone.png"></image>
					<input class="field uni-dialog-input" v-model="username">
				</view>
				<view class="line">
					<image src="/static/lock.png"></image>
					<input class="field" v-model="password">
					<image src="/static/lock.png"></image>
				</view>
				<view></view>
				<view class="but">
					<button @click="onLogin()">登录</button>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				username:'',
				password:''
			};
		},
		methods:{
			onLogin(){
				var param = {"username":this.username,
								"password":this.password}
				
				console.log(param);
				console.log(this.$api);
				
				this.$api.login(param).then(res=>{
					console.log(res);
				});
			}
		}
	}
</script>

<style lang="scss">
	@font-face {
		font-family: CustomFont;
		src: url('./iconfont.ttf');
	}
	
	.pager{
		background-color: #f7f7f7;
		height:100%;
	}
.header{
	height:30vh;
	border-bottom-right-radius: 10vw;
	border-bottom-left-radius: 10vw;
	background-image: url('/static/header.png');
}
.login{
	background-color: white;
	height:40vh;
	width:90vw;
	border-radius: 10px;
	position: absolute;
	left:5vw;
	top:25vh;
	image{
		width:28px;
		height:28px;
		color:#2589ff;
	}
	.panel{
		width:80%;
		margin:20% auto;
		// border:1px red solid;
		.line{
			margin-top:20px;
			display: flex;
			height:35px;
			border-bottom:1px solid #e9e9e9 !important;
		}
		.field{
			border:1px red greenyellow;
		}
		.but{
				margin-top:20px;
				button{
					border-radius: 20px;
					background-color: #2589ff;
					color:white;
				}
		}
	}
}
</style>
